﻿<Window x:Class="MetroToolkitBaseApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
        xmlns:MetroToolkit="clr-namespace:MetroToolkit;assembly=MetroToolkit"
        Title="MainWindow" 
        Height="350" 
        Width="525"
        Style="{DynamicResource MetroWindow}"
        PreviewMouseMove="HandlePreviewMouseMove">

    <!-- Interaction Behaviors -->
    <i:Interaction.Behaviors>
        <MetroToolkit:BorderlessWindowBehavior/>
    </i:Interaction.Behaviors>

    <Grid Name="LayoutRoot" Background="{DynamicResource MetroWindowBackground}">
        <!-- Rectangles to handle resizing the Window -->
        <Rectangle Stroke="{x:Null}" x:Name="top" VerticalAlignment="Top" Height="7" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Margin="8,0,8,0" Fill="#00000000"/>
        <Rectangle Stroke="{x:Null}" x:Name="bottom" Height="7" VerticalAlignment="Bottom" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Margin="8,0,8,0" Fill="#00000000"/>
        <Rectangle Stroke="{x:Null}" x:Name="left" HorizontalAlignment="Left" Margin="0,7,0,7" Width="8" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
        <Rectangle Stroke="{x:Null}" x:Name="right" Margin="0,7,0,7" Width="8" HorizontalAlignment="Right" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
        <Rectangle Stroke="{x:Null}" x:Name="bottomLeft" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="8" Height="7" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
        <Rectangle Stroke="{x:Null}" x:Name="bottomRight" VerticalAlignment="Bottom" Height="7" Width="8" HorizontalAlignment="Right" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
        <Rectangle Stroke="{x:Null}" x:Name="topRight" HorizontalAlignment="Right" Width="8" Height="7" VerticalAlignment="Top" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
        <Rectangle Stroke="{x:Null}" x:Name="topLeft" HorizontalAlignment="Left" Width="8" VerticalAlignment="Top" Height="7" PreviewMouseLeftButtonDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
        
        <!-- Main Content -->
        <DockPanel>
            <!-- Window Commands -->
            <Grid Name="HeaderPanel" Height="40" DockPanel.Dock="Top">
                <Grid.ContextMenu>
                    <ContextMenu>
                        <MenuItem Name="MinimizeMenuItem" Header="Minimize" Click="MinimizeButton_Click" />
                        <MenuItem Name="MaximizeMenuItem" Header="Maximize" Click="MaximizeButton_Click" />
                        <MenuItem Name="RestoreMenuItem" Header="Restore" Visibility="Collapsed" Click="MaximizeButton_Click" />
                        <Separator />
                        <MenuItem Name="CloseMenuItem" Header="Close" Click="CloseButton_Click" />
                    </ContextMenu>
                </Grid.ContextMenu>
                
                <TextBlock Text="MetroToolkit Base App Sample" Foreground="{DynamicResource MetroText}" Margin="12,4,0,0" />
                
                <StackPanel HorizontalAlignment="Right" Margin="0,0,6,0" Orientation="Horizontal">
                    <StackPanel x:Name="OptionsPanel" Orientation="Horizontal">
                        <Button Name="SettingsButton" Foreground="{DynamicResource MetroText}" Style="{DynamicResource MetroToolButton}" Margin="0,4,0,0" Content="SETTINGS" VerticalAlignment="Top" Visibility="Visible" FontSize="10" />
                        <TextBlock Foreground="{DynamicResource MetroText}" Text="|" Margin="3,4,3,0" FontSize="10" />
                        <Button Name="AboutButton" Foreground="{DynamicResource MetroText}" Style="{DynamicResource MetroToolButton}" Margin="0,4,15,0" Content="ABOUT" VerticalAlignment="Top" Visibility="Visible" FontSize="10" />
                    </StackPanel>
                    
                    <StackPanel Name="WindowControls" Orientation="Horizontal" VerticalAlignment="Top">
                        <Button Name="MinimizeButton" Style="{DynamicResource MetroToolButton}" Height="23" Width="19" ToolTip="Minimize" Click="MinimizeButton_Click">
                            <Border Margin="2">
                                <Image Source="/MetroToolkit;component/Resources/Images/min.png" RenderOptions.BitmapScalingMode="HighQuality" />
                            </Border>
                        </Button>
                        <Button Name="MaximizeButton" Style="{DynamicResource MetroToolButton}" Height="23" Width="19" ToolTip="Maximize" Click="MaximizeButton_Click">
                            <Border Margin="2">
                                <Image Source="/MetroToolkit;component/Resources/Images/max.png" RenderOptions.BitmapScalingMode="HighQuality" />
                            </Border>
                        </Button>
                        <Button Name="RestoreButton" Style="{DynamicResource MetroToolButton}" Height="23" Width="19" ToolTip="Restore" Visibility="Collapsed" Click="MaximizeButton_Click">
                            <Border Margin="2">
                                <Image Source="/MetroToolkit;component/Resources/Images/restore.png" RenderOptions.BitmapScalingMode="HighQuality" />
                            </Border>
                        </Button>
                        <Button Name="CloseButton" Style="{DynamicResource MetroToolButton}" Height="23" Width="19" ToolTip="Close" Click="CloseButton_Click">
                            <Border Margin="2">
                                <Image Source="/MetroToolkit;component/Resources/Images/close.png" RenderOptions.BitmapScalingMode="HighQuality" />
                            </Border>
                        </Button>
                    </StackPanel>
                </StackPanel>
            </Grid>

            <Grid Name="ContentPanel">
                <!-- Add your content here -->
            </Grid>
        </DockPanel>
    </Grid>
</Window>
